/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package menudesktop;

import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import PanelesDeTrabajo.*;

/**
 *
 * @author 
 */
class Ventana extends JFrame{

    private PanelSuperior barra;
    private PanelBarOpciones opciones;
    private JPanel panelPrincipal;
    
    private PanelPrincipalMenu panelPrincipalMenu;
    private VisorDePedidos panelVisorPedidos;
    private PanelPrincipalProducto panelPrincipalProducto;
    private PanelPrincipalPlato panelPrincipalPlato;
    private MapaRestaurant panelMapa;
    private PanelInformes panelInformes;
    
    public Ventana() {
        super("Menu Desktop");
        this.setLayout(new BorderLayout());
        this.setSize(850, 600);
        this.setLocationRelativeTo(null);
        this.setResizable(false);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        //-------------------------------------------
        this.barra = new PanelSuperior(this);
        this.opciones =  new PanelBarOpciones(this);
        this.panelPrincipal = new JPanel(new BorderLayout());
        
        //----------------------------------------------------------------------
        //--                              Paneles
            panelPrincipalMenu = new PanelPrincipalMenu();
            panelVisorPedidos = new VisorDePedidos();
            panelPrincipalProducto = new PanelPrincipalProducto();
            panelPrincipalPlato = new PanelPrincipalPlato();
            panelMapa = new MapaRestaurant();
            panelInformes = new PanelInformes();
        //----------------------------------------------------------------------
        this.panelPrincipal.add(panelMapa, BorderLayout.CENTER);
        this.setJMenuBar(this.barra);
        this.add(this.opciones, BorderLayout.WEST);
        this.add(this.panelPrincipal, BorderLayout.CENTER);
    }
    public void cambiarAPaneluno(){
        this.panelPrincipal.removeAll();
        this.panelPrincipal.add(panelPrincipalMenu, BorderLayout.CENTER);
        this.panelPrincipal.updateUI();
    }
    
    public void cambiarAPanelMapa(){
        this.panelPrincipal.removeAll();
        this.panelPrincipal.add(panelMapa, BorderLayout.CENTER);
        this.panelPrincipal.updateUI();
    }
    public void cambiarAPaneldos(){
        this.panelPrincipal.removeAll();
        this.panelPrincipal.add(panelVisorPedidos, BorderLayout.CENTER);
        this.panelPrincipal.updateUI();
    }
    public void cambiarAPaneltres(){
        this.panelPrincipal.removeAll();
        this.panelPrincipal.add(panelPrincipalProducto, BorderLayout.CENTER);
        this.panelPrincipal.updateUI();
    }
    public void cambiarAPanelcuatro(){
        this.panelPrincipal.removeAll();
        this.panelPrincipal.add(panelPrincipalPlato, BorderLayout.CENTER);
        this.panelPrincipal.updateUI();
    }
    public void cambiarAPanelCinco()
    {
        this.panelPrincipal.removeAll();
        this.panelPrincipal.add(panelInformes, BorderLayout.CENTER);
        this.panelPrincipal.updateUI();
    }
}
